<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>服务详情</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <link href="../../resources/css/common/bootstrap3.min.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/css/common/datetimepicker.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/css/common/page.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="../../resources/css/common/component.css"/>
    <link rel="stylesheet" type="text/css" href="../../resources/css/common/Huploadify.css"/>
    <link rel="Bookmark" href="../../resources/img/login/icon.png" >
    <link rel="Shortcut Icon" href="../../resources/img/login/icon.png" />
    <script type="text/javascript" charset="utf-8" src="../../UE/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../UE/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="../../UE/lang/zh-cn/zh-cn.js"></script>
    <style type="text/css">
        #demo {
            margin-top: 20px;
        }
    </style>
</head>

<baby>

    <div class="container" style="margin-bottom: 40px;">
        <div class="page-header navbar-color">
            <h1 id="navbars">服务详情</h1>
        </div>
        <div id="demo">
            <div class="form-horizontal add-border">
                <input type="hidden" v-model="type" id="type" class="form-control">
                <div class="form-group">
                    <label class="col-sm-3 control-label">名称:</label>
                    <div class="col-sm-3">
                        <input type="text" v-model="name"  value="" class="form-control" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script></div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-10">
                        <button type="button" class="btn btn-primary" @click="modifyInfo()">提交</button>
                    </div>
                </div>
            </div>

        </div>
    </div>

</baby>
<script type="text/javascript" src="../../resources/js/common/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../resources/js/common/jquery.Huploadify.js"></script>
<script src="../../resources/js/common/bootstrap3.min.js" type="text/javascript"></script>
<script src="../../resources/js/common/vue.min.js"></script>
<script src="../../resources/js/common/common.js"></script>
<script type="text/javascript">
    var editor = UE.getEditor('content');
</script>


<script>
    var html = window.location.href;
    var arr = html.split("=");
    var ue = UE.getEditor('editor');
    var demo = new Vue({
        el: '#demo',
        data: {
            name:"",
            booking:'',
            content:'',
            shopId:''
        }, methods: {
            modifyInfo: function () {
                var content = ue.getContent();
                var param = {};
                param['key'] = "content";
                param['value'] = content;
                param['id'] = arr[1];
                var flag = executeAjaxByPost('/backend/booking/modifyBooking',param);
                if(flag.status == 1){
                    alert("修改成功");
                    window.location.href="/html/booking/list.html?shopId="+this.shopId;
                }else{
                    alert("修改失败!请联系管理员");
                    return;
                }
            }
        },created:function () {
            this.booking =executeAjaxByGet('/backend/booking/getBookingById?id='+arr[1], '');
            this.content=this.booking.content;
            this.name = this.booking.name;
            this.shopId = this.booking.shopId;
        },
        mounted: function () {

        }
    });
        UE.getEditor('editor').ready(function() {
            UE.getEditor('editor').setContent(demo.$data.content,2);
        },2);
</script>
</html>